<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>Rent-a-car</title>
</head>
<body>
<script type="text/javascript">
function ajaxFunction()
  {
  var xmlHttp;
  try
    {
    // Firefox, Opera 8.0+, Safari
    xmlHttp=new XMLHttpRequest();
    }
  catch (e)
    {
    // Internet Explorer
    try
      {
      xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
      }
    catch (e)
      {
      try
        {
        xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
        }
      catch (e)
        {
        alert("Your browser does not support AJAX!");
        return false;
        }
      }
    }
  	var zaPronaci = document.getElementById("usernameID").value;
  	var url = "vrm.php?zaPronaci=" + zaPronaci;
	xmlHttp.open("GET",url,true);
    xmlHttp.send(null);
    xmlHttp.onreadystatechange=function()
      {
      if(xmlHttp.readyState==4)
        {
        document.mojaForma.vreme.value=xmlHttp.responseText;
        }
      }
 
  }
</script>
<form id="" action="" method="post" name="mojaForma" >
Ime: <input type="text" id="usernameID" onkeyup="ajaxFunction()" name="ime" /> </br>
Vreme se ispisuje bez ponovnog ucitavanja stranice </br>
Vreme: <input type="text" name="vreme" id="vreme" size="40" /></form>
</body>
</html>
